function G(id){
    return document.getElementById(id);
};
function GC(t){
   return document.createElement(t);
};
String.prototype.trim = function(){
          return this.replace(/(^\s*)|(\s*$)/g, '');
};
function isIE(){
     return (document.all && window.ActiveXObject && !window.opera) ? true : false;
}

function popCoverDiv(){
 if (G("cover_div")) {
  G("cover_div").style.display = '';
   } else {
    var coverDiv = GC('div');
    document.body.appendChild(coverDiv);
    coverDiv.id = 'cover_div';
    with(coverDiv.style) {
     position = 'absolute';
     background = '#000000';
     left = '0px';
     top = '0px';
var bodySize = getBodySize();
     width = bodySize[0] + 'px'
     height = bodySize[1] + 'px';
     zIndex = 4;
     if (isIE()) {
      filter = "Alpha(Opacity=40)";
     } else {
      opacity = 0.4;
     }
    }
   }
}
function getBodySize(){
   var bodySize = [];
   with(document.documentElement) {
    bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;
    bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;
   }
   return bodySize;
}
function show(o){
 var o = document.getElementById(o);
 o.style.display = "";
 popCoverDiv(); 
 //document.body.style.overflow = "hidden";
}
function hide(o){
 var o = document.getElementById(o);
 o.style.display ="none";
 G("cover_div").style.display = 'none';
// document.body.style.overflow = '';
}